<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=0,user-scalable=0">
[#include "/wap/include/static.html"]
    <link rel="stylesheet" href="${path}/resources/wap/css/base/base.css"/>
    <link rel="stylesheet" href="${path}/resources/wap/css/me/Certification.css"/>
</head>
<body>
<!--头部-->
<div id="header"   onclick="window.location.href='${path}/wap/member'" >
    <div class="left">
        <img id="goBack" src="${path}/resources/wap/img/invest/back.png">
    </div>
    <div class="center">
        实名认证
    </div>
</div>
<form class="layui-form">
<!--输入框-->
<div id="matter">
    <div class="matter-option">
        <label for="name">真实姓名</label><input id="real_name"  [#if ((auth.status)!'')==1]disabled="disabled" [/#if] value="${auth.real_name}" name="real_name" placeholder="请输入真实姓名">
    </div>

    <div class="matter-option">
        <label for="ID">身份证号</label><input name="idnumber" [#if ((auth.status)!'')==1 ]disabled="disabled" [/#if] value="${auth.id_number}" id="idnumber" placeholder="请输入身份证号码">
    </div>
</div>


<!--按钮-->
<div class="type-one">
[#if ((auth.status)!'')==0 ]
    <input type="button" name="" value=" 审 核 中 " lay-submit class="layui-btn"  lay-filter="MainForm" />
[#elseif ((auth.status)!'')==1 ]
    <input type="button" name="" value="已 认 证" class="layui-btn"disabled style="background-color: #c2c2c2"/>
[#elseif ((auth.status)!'')==-1 ]
    <button lay-submit lay-filter="MainForm"  class="layui-btn"  style="width: 100px;background-color: #f3485a">重新认证</button>

[#else]
    <button lay-submit lay-filter="MainForm" class="layui-btn"  style="width: 100px;background-color: #f3485a">确认提交</button>

[/#if]


[#--[#if auth??]--]
    [#--<input type="button" name="" value=" 已认证 " disabled style="background-color: #c2c2c2"/>--]

[#--[#else]--]
    [#--<button lay-submit lay-filter="MainForm"  style="width: 100px;background-color: #f3485a">确认提交</button>--]
[#--[/#if]--]
</form>
</div>
<script>
    $(function() {
        layui.use(['form','upload'],function(){
            var form = layui.form(), $=layui.jquery, layer = layui.layer;
            layui.upload({
                elem:'#pic1'
                ,url: '/system/upload/submit'
                ,success: function(res){
                    if (res["error"] == 0) {

                        $('#pic1_img').attr("src", res["url"]);
                        $('#pic1_src').val(res["url"]);

                    } else {
                        layer.msg(res["message"]);
                    }
                }
            });
            layui.upload({
                elem:'#pic2'
                ,url: '/system/upload/submit'
                ,success: function(res){
                    if (res["error"] == 0) {
                        $('#pic2_img').attr("src", res["url"]);
                        $('#pic2_src').val(res["url"]);

                    } else {
                        layer.msg(res["message"]);
                    }
                }
            });


            form.on('submit(MainForm)', function(data){
                var index = layer.load();
                ajax({
                    url:"${path}/wap/member/auth/certification",
                    data: data.field,
                    success: function(result){
                        layer.msg(result.content,function() {
                            location.reload();
                        });
                        layer.close(index);
                    },
                    complete:function(){
                        layer.close(index);
                    },error:function(){
                        layer.close(index);
                    }
                });
                return false;
            });
        });
    });
</script>

</body>

</html>